--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Commit 1c117507c48508e8af2e3f8a23f3ef2dc4c3b4dd
Parents : 6e0d8b9
Author : zenith <157907903+RFnexus@users.noreply.github.com>
Date : 2026-05-14T12:43:48-04:00
Change AutoWho regex to match partial hashes
Changes
2 files changed, 3 insertions(+), 3 deletions(-)
Diff
diff --git a/nomadnet/RRC.py b/nomadnet/RRC.py
index fa8d088..bc1766c 100644
--- a/nomadnet/RRC.py
+++ b/nomadnet/RRC.py
@@ -104,7 +104,7 @@ def _msg_id():
# greedy .+ intentionally captures nicks containing parens like "user (alt) (deadbeefcafe)"
_WHO_ENTRY_RE = re.compile(
r"(?:^|,\s)"
- r"(?:(?P<nick>.+?)\s\((?P<np>[0-9a-fA-F]+)\)|(?P<bh>[0-9a-fA-F]+))"
+ r"(?:(?P<bh>[0-9a-fA-F]{32})|(?P<nick>.+?)\s\((?P<np>[0-9a-fA-F]{12})\))"
r"(?=,\s|$)"
)
@@ -279,7 +279,7 @@ class RRCHub:
nick = self.nicks.get(ph)
if nick:
return nick
- return ph.hex()[:10]
+ return ph.hex()[:12]
def mark_read(self, room):
r = self._normalize_room(room)
diff --git a/nomadnet/ui/textui/Channels.py b/nomadnet/ui/textui/Channels.py
index 52342c7..0e62a7c 100644
--- a/nomadnet/ui/textui/Channels.py
+++ b/nomadnet/ui/textui/Channels.py
@@ -137,7 +137,7 @@ def _body_markup(body, body_attr="body_text", own_nick=None):
return out, has_links
-def _short_hash(b, n=10):
+def _short_hash(b, n=12):
if isinstance(b, (bytes, bytearray)):
return bytes(b).hex()[:n]
return "?"
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────